package com.brite.android.game.action;

public class TimeCounter {
	private float mTotal;
	public float mCurrent;
	public TimeCounter() {
		mTotal = 0;
		mCurrent = 0;
	}
	public TimeCounter(float pTotal) {
		mTotal = pTotal;
		mCurrent = 0;
	}
	
	public void setTotal(float pTotal) {
		mTotal = pTotal;
	}
	
	public float getTotal() {
		return mTotal;
	}
	
	public void start() {
		mCurrent = 0;		
	}
	
	public boolean currentStatus() {
		if (mTotal<0) {
			return true;
		}
		return mCurrent<mTotal;
	}
	
	/**
	 * @return 	false	if out of time 			
	 */
	public boolean update(float pTime) {
		if (mTotal<0) {
			return true;
		}
		mCurrent += pTime;
		return mCurrent<mTotal;
	}
}
